/*
 * 
 */
package com.oniontech.stamptour;

import android.accounts.NetworkErrorException;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;

import com.oniontech.stamptour.common.lang.LOG;
import com.oniontech.stamptour.common.ui.CustomDialog;
import com.oniontech.stamptour.common.ui.DefaultActivity;
import com.oniontech.stamptour.common.ui.ProgressDialog;
import com.oniontech.stamptour.common.util.SharedPreperenceUtil;
import com.oniontech.stamptour.module.nfc.StampNfcManager;

// TODO: Auto-generated Javadoc
/**
 * The Class IntroActivity.
 */
public class IntroActivity extends DefaultActivity
{
	
	/** The version chk. */
	private final int VERSION_CHK = 0;
	
	/** The now status. */
	private int nowStatus = VERSION_CHK;
	
	/**
	 * Instantiates a new intro activity.
	 */
	public IntroActivity()
	{
		super(IntroActivity.class.getSimpleName());
	}

	/** The progress dialog. */
	protected ProgressDialog progressDialog = null;
	/** The msg. */
	private String msg = null;
	
	/* (non-Javadoc)
	 * @see com.oniontech.stamptour.common.ui.DefaultActivity#onCreate(android.os.Bundle)
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.intro);

      	setUi();
      	
      	nextStep();
	}
	
	/**
	 * Sets the ui.
	 */
	private void setUi() {
		if(progressDialog == null) {
			progressDialog = new ProgressDialog(this);
			progressDialog.setCancelable(false);
		}
	}

    /**
	 * Next step.
	 */
	private void nextStep() {
		goNextActivity(MainActivity.class);
	}

    /** The infoclick. */
	OnClickListener infoclick = new OnClickListener()
	{

		@Override
		public void onClick(View v)
		{
			switch (v.getId())
			{
			case R.id.btn_dial_confirm:
				break;
			}
		}
	};
	
	
	/**
	 * Go next activity.
	 *
	 * @param cls the cls
	 */
	private void goNextActivity(final Class <?> cls) {
		new Thread()
		{
			public void run()
			{
				try
				{
					Thread.sleep(2000);
				} catch (InterruptedException e)
				{
					// TODO Auto-generated catch block
					System.out.println("예외 발생");
				}
				
				Intent intent = new Intent(m_AppContext, cls);
				intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
				intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
				intent.putExtra("msg", msg);
				startFootDepthPage(intent);
			}
			
		}.start();
	}
}
